package Dao

func GetallgoodsClass() (error, []Goods_class, int64) {
	var goodsdate []Goods_class
	var total int64
	err := Db.Table("goods_class").Order("gc_id").Count(&total).Find(&goodsdate).Error
	return err, goodsdate, total
}

func AddgoodsClass(goods Goods_class) (error) {
	err := Db.Table("goods_class").Select("gc_id", "gc_info","is_del").Create(&goods).Error
	return err
}

func UpdategoodsClass(goods Goods_class)(error){
	err := Db.Table("goods_class").Where("gc_id = ?", goods.Gc_id).Updates(&goods).Error
	return err
}

func DeletegoodsClass(id string)(error) {
	var class []Goods_class
	err := Db.Table("goods_class").Where("gc_id = ?", id).Delete(&class).Error
	return err
}
